package com.qinggeng.project.system.service.impl;

import com.qinggeng.common.enums.CommonEnum;
import com.qinggeng.common.utils.DateUtils;
import com.qinggeng.project.system.domain.RegionalAgency;
import com.qinggeng.project.system.mapper.RegionalAgencyMapper;
import com.qinggeng.project.system.service.IRegionalAgencyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RegionalAgencyServiceImpl implements IRegionalAgencyService {
    @Resource
    private RegionalAgencyMapper agencyMapper;
    @Override
    public int insertRegionalAgency(RegionalAgency agency) {
        agency.setStatus(CommonEnum.STATUS_10.getValue());
        agency.setCreateTime(DateUtils.getNowDate());
        return agencyMapper.insertRegionalAgency(agency);
    }

    @Override
    public int deleteRegionalAgencyById(Long id) {
        return agencyMapper.deleteRegionalAgencyById(id);
    }

    @Override
    public int deleteRegionalAgencyByIds(Long[] ids) {
        return agencyMapper.deleteRegionalAgencyByIds(ids);
    }

    @Override
    public int updateRegionalAgency(RegionalAgency agency) {
        return agencyMapper.updateRegionalAgency(agency);
    }

    @Override
    public List<RegionalAgency> listRegionalAgency(RegionalAgency where) {
        return agencyMapper.listRegionalAgency(where);
    }

    @Override
    public RegionalAgency getRegionalAgencyById(Long id) {
        return agencyMapper.getRegionalAgencyById(id);
    }
}
